﻿@using Course.Models
@{
    ViewBag.Title = "CategoryAdd";
}
<html>
<head>
    <title>后台</title>
</head>
<body>
    <div id="body-wrapper">
        @RenderPage("../Shared/BackLeft.cshtml")
      <form action="CategoryAdd" method="post">
            <div id="main-content">
                <!-- Main Content Section with everything -->
                <noscript>
                    <!-- Show a notification if the user has disabled javascript -->
                    <div class="notification error png_bg">
                        <div>
                            Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/"
                                title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852"
                                    title="Enable Javascript in your browser">enable</a> Javascript to navigate
                            the interface properly. Download From <a href="http://www.exet.tk">exet.tk</a></div>
                    </div>
                </noscript>
                <div class="content-box">
                    <!-- Start Content Box -->
                    <div class="content-box-header">
                        <h3>
                            分类</h3>
                        @*  <ul class="content-box-tabs">
                        <li><a href="#tab1" class="default-tab">分类</a></li>
                        <!-- href must be unique and match the id of target div -->
                        <li><a href="#tab2">Forms</a></li>
                    </ul>*@
                        <div class="clear">
                        </div>
                    </div>
                    @{IQueryable<Category> allCate = ViewData["allCate"] as IQueryable<Category>;}
                    <!-- End .content-box-header -->
                    <div class="content-box-content">
                        <div class="tab-content default-tab" id="tab1">
                            <!-- This is the target div. id must match the href of this div's tab -->
                            <div class="notification attention png_bg">
                                <a href="#" class="close">
                                    <img src="@Url.Content("~/Content/Images/icons/cross_grey_small.png")" title="Close this notification" alt="close" /></a>
                                <div>
                                    添加内容时注意格式
                                </div>
                            </div>
                            @Html.Label("分类名称")
                            <input type="text" name="CategoryName" />
                            @Html.Label("父类")
                         @{
                             List<SelectListItem> items = new List<SelectListItem>();
                             
                             foreach(var cate in allCate)
                             {
                                 SelectListItem item = new SelectListItem();
                                 item.Value = cate.CategoryID.ToString();
                                 item.Text = cate.CName;

                                 items.Add(item);
                             }
                             }

     
                             @Html.DropDownList("ddlCate",items)
                             @Html.Label("无父类")
                             @*@Html.CheckBox("checkParent", true, new {value="true" })*@
                            <input type="checkbox"  name="checkParent" value="1" />
                            @Html.Label("种类")
                            @{
                                List<SelectListItem> type = new List<SelectListItem>();

                                SelectListItem articleType = new SelectListItem();
                                articleType.Selected = true;
                                articleType.Value = "true";
                                articleType.Text = "文章分类";

                                SelectListItem downloadType = new SelectListItem();
                                downloadType.Text = "下载分类";
                                downloadType.Value = "false";

                                type.Add(articleType);
                                type.Add(downloadType);
                                }
                                @Html.DropDownList("ddlType",type)

                            @Html.Label("排序")
                            <input type="text" name="OrderNum" />
                            <input type="submit" value="提交" />
                        </div>
                        <!-- End #tab1 -->
                    </div>
                    <!-- End .content-box-content -->
                </div>
            </div>
        
        </form>
    </div>
</body>
</html>
